<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs2.jsp" %>
<fmt:message key="framemenu_label1" var="framemenu_label1"/>
<fmt:message key="framemenu_label2" var="framemenu_label2"/>
<html>
<head>
<%@ include file="/common/meta.jsp" %>
<link href="<c:url value="/themes/${sessionScope.loginUser.theme}/style.css"/>" type="text/css" rel=stylesheet>
<script src='<c:url value="/dwr/util.js"/>' type="text/javascript"></script>
<script src='<c:url value="/dwr/interface/ajaxMenuTreeManager.js"/>' type="text/javascript"></script>
<script src='<c:url value="/scripts/ajaxtreeCore.js"/>' type="text/javascript"></script>
<script src='<c:url value="/scripts/ajaxtreeInterface.js"/>' type="text/javascript"></script>
<script src='<c:url value="/scripts/ajaxtreeTools.js"/>' type="text/javascript"></script>
<script src='<c:url value="/scripts/admin.js"/>' type="text/javascript"></script>
<link rel="StyleSheet" href="<c:url value="/themes/${sessionScope.loginUser.theme}/tree/classical/style.css"/>" type="text/css" />
<title></title>
<script type="text/javascript">

var AJAXTREE_AJAXTREECONTEXT = 'AjaxTreeContext';

var ajaxtree_currentLiId;

window.onload = function ajaxtree_initAjaxTree() {
//	if(typeof window['DWRUtil'] == 'undefined') {
//		window.DWRUtil = dwr.util;
//	}
	//DWRUtil.useLoadingMessage();
	ajaxtree_showRootTreeControlNodes();
}

function ajaxtree_showRootTreeControlNodes() {
    event.cancelBubble = true; 
    ajaxMenuTreeManager.getRootTreeControlNodes('${currentmodule}', '${sessionScope.loginUser.id}', ajaxtree_resolveRootTreeControlNodes);
}

function ajaxtree_showChildTreeControlNodes() {
	try {
	    event.cancelBubble = true;
	    var ajaxtree_oldLiId = ajaxtree_currentLiId;

		ajaxtree_currentLiId = window.event.srcElement.id;
		
		if (ajaxtree_isAction(ajaxtree_currentLiId)) {
			try {
				if (ajaxtree_oldLiId != null && ajaxtree_oldLiId != '') {
					$(AJAXTREE_NODE_ACTION + ajaxtree_id(ajaxtree_oldLiId)).className = 'nodeAction';
				}
			} catch (e1) {
			} 		
			$(ajaxtree_currentLiId).className = 'nodeSeleced';			
		}		
		
		if (!ajaxtree_isToggle(ajaxtree_currentLiId)) {
			ajaxtree_currentLiId = AJAXTREE_NODE_TOGGLE + ajaxtree_id(ajaxtree_currentLiId);
			//alert(ajaxtree_currentLiId);
		}
			
		if(!ajaxtree_isToggle(ajaxtree_currentLiId))
			return;
			
		if (ajaxtree_isLoaded(ajaxtree_currentLiId)) {
			ajaxtree_switchToggleWhenLoaded(ajaxtree_currentLiId);
			ajaxtree_switchIconWhenLoaded(ajaxtree_currentLiId);
			ajaxtree_switchDisplayWhenLoaded(ajaxtree_currentLiId);		
			return;
		} else {		
	
	   		ajaxtree_setLoading(ajaxtree_currentLiId);		
			ajaxMenuTreeManager.getChildTreeControlNodes('${currentmodule}', ajaxtree_id(ajaxtree_currentLiId), ajaxtree_resolveChildTreeControlNodes);   		
			ajaxtree_setLoaded(ajaxtree_currentLiId);
		}
	} catch (e) {
	}
}
</script>
<script type="text/javascript">
function test() {
	//var treeContext = ajaxtree_getAjaxTreeContext();
	var ajaxTree = document.getElementById("ajaxtree");
	document.getElementById("treescript").value = ajaxTree.innerHTML;
	//alert(node.childNodes[0].childNodes.length);
	//alert(node.nodeValue);
}
</script>

</head>
<body marginheight="0" marginwidth="0" rightmargin="0" topmargin="0" leftmargin="0">
<table border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td>
<SPAN id='ajaxtree'>
<UL class=more id='AjaxTreeContext'>
	<LI class='root'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${currentmoduleObject.name} [<a href="javascript:void(0);" title="${framemenu_label2}" onclick="window.location.reload();">${framemenu_label1}</a>]</LI>
</UL>
</SPAN>
		</td>
	</tr>
</table>
</body>
</html>